<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>编辑图书</title>
	<jsp:include page="/pages/common/head.jsp"></jsp:include>

<style type="text/css">
	h1 {
		text-align: center;
		margin-top: 200px;
	}
	
	h1 a {
		color:red;
	}
	
	input {
		text-align: center;
	}

	#main .submitBtn{
		display: inline-block;
		padding: 5px 6px;
		background-color: #409eff;
		transition: 0.1s;
		font-size: 17px;
		color: #fff;
		text-decoration: none;
		border-radius: 3px;
		border: none;
	}

	#main .submitBtn:hover{
		background-color: #66b1ff;
	}
</style>
</head>
<body>
		<div id="header">

			<span class="wel_word">编辑图书</span>
			<%@include file="/pages/common/manager_menu.jsp"%>

		</div>

		<div id="main">
			<form action="manager/bookServlet?action=${empty requestScope.book ? "add": "update"}&pageNo=${param.pageNo}
			&id=${requestScope.book.id}&imgPath=${requestScope.book.img_path}"
				  method="post" enctype="multipart/form-data">
<%--				<input type="hidden" name="pageNo" value="${param.pageNo}">--%>
<%--				<input type="hidden" name="id" value="${requestScope.book.id}">--%>
				<table>
					<tr>
						<td>名称</td>
						<td>价格</td>
						<td>作者</td>
						<td>销量</td>
						<td>库存</td>
						<td>封面图片</td>
						<td>操作</td>
					</tr>		
					<tr>
						<td><input name="name" type="text" value="${requestScope.book.name}"/></td>
						<td><input name="price" type="text" value="${requestScope.book.price}" style="width: 70px"/></td>
						<td><input name="author" type="text" value="${requestScope.book.author}"/></td>
						<td><input name="sales" type="text" value="${requestScope.book.sales}"/></td>
						<td><input name="stock" type="text" value="${requestScope.book.stock}"/></td>
						<td>
							<input type="file" name="img_path">
							<img src="${requestScope.book.img_path}" width="150">
						</td>
						<td><input class="submitBtn" type="submit" value="提交"/></td>
					</tr>	
				</table>
			</form>
			
	
		</div>

		<%--静态包含页脚内容--%>
		<%@include file="/pages/common/foot.jsp"%>
</body>
</html>